package com.example.administrator.foodrowfresh.configs.classifyconfing.classifyentity;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONException;
import org.json.JSONObject;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by lqr on 2016/5/4.
 */
public class MyClassifyDetailItemEntity {


    /**
     * success : 1
     * data : {"banner":[{"PictureId":1,"image":"http://images4sh-app.34580.com/images/ProductImages/SH_Image_1_jpeg_640.jpeg"}],"product":{"buy_end_time":"","number":"2201075","name":"红苋菜","place":"中国","brand":"未知","store":"冷藏","published":"1","release_time":"2012-10-12 00:00:00","sell":"22462","present":"","stock_quantity":"0","out_stock":"0","DisplayStockAvailability":"False","reminder":"","sx_price_name":"食行价","sx_price":"3.50","sp_weight":"500g","old_price_name":"市场价","old_price":"4.00","old_price_weight":"500g","rate_price":"2.80","rate_weight":"400g","standard":"","info":"","last_time_info":"此商品当日23:59:59前下单，可明日送达；超过时间可后日送达。","end_last_time":"","max_end_time":"","id":"73","max_qcp_end_time":"","collect":"0","TotalPoint":"5","ExsitReflex":"请先购买该产品"},"productserives":[{"Id":"3","BGColor":"#2ccaa2","Name":"24小时退/换货","WapUrl":"","ProductId":"73"},{"Id":"2","BGColor":"#9fd82a","Name":"限时配送","WapUrl":"","ProductId":"73"},{"Id":"1","BGColor":"#5ccae5","Name":"自提免运费","WapUrl":"","ProductId":"73"}],"promotionalActivities":[{"Id":"16","TypeName":"换购","Name":"满39元换购","Type":"1","Descrption":"【全场】满39元可换购红蛇果、微丰小黄米、肉粽子、骨肉相连","ReferType":"0"}]}
     */

    private int success;
    /**
     * banner : [{"PictureId":1,"image":"http://images4sh-app.34580.com/images/ProductImages/SH_Image_1_jpeg_640.jpeg"}]
     * product : {"buy_end_time":"","number":"2201075","name":"红苋菜","place":"中国","brand":"未知","store":"冷藏","published":"1","release_time":"2012-10-12 00:00:00","sell":"22462","present":"","stock_quantity":"0","out_stock":"0","DisplayStockAvailability":"False","reminder":"","sx_price_name":"食行价","sx_price":"3.50","sp_weight":"500g","old_price_name":"市场价","old_price":"4.00","old_price_weight":"500g","rate_price":"2.80","rate_weight":"400g","standard":"","info":"","last_time_info":"此商品当日23:59:59前下单，可明日送达；超过时间可后日送达。","end_last_time":"","max_end_time":"","id":"73","max_qcp_end_time":"","collect":"0","TotalPoint":"5","ExsitReflex":"请先购买该产品"}
     * productserives : [{"Id":"3","BGColor":"#2ccaa2","Name":"24小时退/换货","WapUrl":"","ProductId":"73"},{"Id":"2","BGColor":"#9fd82a","Name":"限时配送","WapUrl":"","ProductId":"73"},{"Id":"1","BGColor":"#5ccae5","Name":"自提免运费","WapUrl":"","ProductId":"73"}]
     * promotionalActivities : [{"Id":"16","TypeName":"换购","Name":"满39元换购","Type":"1","Descrption":"【全场】满39元可换购红蛇果、微丰小黄米、肉粽子、骨肉相连","ReferType":"0"}]
     */

    private DataBean data;

    public static MyClassifyDetailItemEntity objectFromData(String str) {

        return new Gson().fromJson(str, MyClassifyDetailItemEntity.class);
    }

    public static MyClassifyDetailItemEntity objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), MyClassifyDetailItemEntity.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public static List<MyClassifyDetailItemEntity> arrayMyClassifyDetailItemEntityFromData(String str) {

        Type listType = new TypeToken<ArrayList<MyClassifyDetailItemEntity>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public static List<MyClassifyDetailItemEntity> arrayMyClassifyDetailItemEntityFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);
            Type listType = new TypeToken<ArrayList<MyClassifyDetailItemEntity>>() {
            }.getType();

            return new Gson().fromJson(jsonObject.getString(str), listType);

        } catch (JSONException e) {
            e.printStackTrace();
        }

        return new ArrayList();


    }

    public int getSuccess() {
        return success;
    }

    public void setSuccess(int success) {
        this.success = success;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public static class DataBean {
        /**
         * buy_end_time :
         * number : 2201075
         * name : 红苋菜
         * place : 中国
         * brand : 未知
         * store : 冷藏
         * published : 1
         * release_time : 2012-10-12 00:00:00
         * sell : 22462
         * present :
         * stock_quantity : 0
         * out_stock : 0
         * DisplayStockAvailability : False
         * reminder :
         * sx_price_name : 食行价
         * sx_price : 3.50
         * sp_weight : 500g
         * old_price_name : 市场价
         * old_price : 4.00
         * old_price_weight : 500g
         * rate_price : 2.80
         * rate_weight : 400g
         * standard :
         * info :
         * last_time_info : 此商品当日23:59:59前下单，可明日送达；超过时间可后日送达。
         * end_last_time :
         * max_end_time :
         * id : 73
         * max_qcp_end_time :
         * collect : 0
         * TotalPoint : 5
         * ExsitReflex : 请先购买该产品
         */

        private ProductBean product;
        /**
         * PictureId : 1
         * image : http://images4sh-app.34580.com/images/ProductImages/SH_Image_1_jpeg_640.jpeg
         */

        private List<BannerBean> banner;
        /**
         * Id : 3
         * BGColor : #2ccaa2
         * Name : 24小时退/换货
         * WapUrl :
         * ProductId : 73
         */

        private List<ProductserivesBean> productserives;
        /**
         * Id : 16
         * TypeName : 换购
         * Name : 满39元换购
         * Type : 1
         * Descrption : 【全场】满39元可换购红蛇果、微丰小黄米、肉粽子、骨肉相连
         * ReferType : 0
         */

        private List<PromotionalActivitiesBean> promotionalActivities;

        public static DataBean objectFromData(String str) {

            return new Gson().fromJson(str, DataBean.class);
        }

        public static DataBean objectFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);

                return new Gson().fromJson(jsonObject.getString(str), DataBean.class);
            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        public static List<DataBean> arrayDataBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<DataBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public static List<DataBean> arrayDataBeanFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);
                Type listType = new TypeToken<ArrayList<DataBean>>() {
                }.getType();

                return new Gson().fromJson(jsonObject.getString(str), listType);

            } catch (JSONException e) {
                e.printStackTrace();
            }

            return new ArrayList();


        }

        public ProductBean getProduct() {
            return product;
        }

        public void setProduct(ProductBean product) {
            this.product = product;
        }

        public List<BannerBean> getBanner() {
            return banner;
        }

        public void setBanner(List<BannerBean> banner) {
            this.banner = banner;
        }

        public List<ProductserivesBean> getProductserives() {
            return productserives;
        }

        public void setProductserives(List<ProductserivesBean> productserives) {
            this.productserives = productserives;
        }

        public List<PromotionalActivitiesBean> getPromotionalActivities() {
            return promotionalActivities;
        }

        public void setPromotionalActivities(List<PromotionalActivitiesBean> promotionalActivities) {
            this.promotionalActivities = promotionalActivities;
        }

        public static class ProductBean {
            private String buy_end_time;
            private String number;
            private String name;
            private String place;
            private String brand;
            private String store;
            private String published;
            private String release_time;
            private String sell;
            private String present;
            private String stock_quantity;
            private String out_stock;
            private String DisplayStockAvailability;
            private String reminder;
            private String sx_price_name;
            private String sx_price;
            private String sp_weight;
            private String old_price_name;
            private String old_price;
            private String old_price_weight;
            private String rate_price;
            private String rate_weight;
            private String standard;
            private String info;
            private String last_time_info;
            private String end_last_time;
            private String max_end_time;
            private String id;
            private String max_qcp_end_time;
            private String collect;
            private String TotalPoint;
            private String ExsitReflex;

            public static ProductBean objectFromData(String str) {

                return new Gson().fromJson(str, ProductBean.class);
            }

            public static ProductBean objectFromData(String str, String key) {

                try {
                    JSONObject jsonObject = new JSONObject(str);

                    return new Gson().fromJson(jsonObject.getString(str), ProductBean.class);
                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return null;
            }

            public static List<ProductBean> arrayProductBeanFromData(String str) {

                Type listType = new TypeToken<ArrayList<ProductBean>>() {
                }.getType();

                return new Gson().fromJson(str, listType);
            }

            public static List<ProductBean> arrayProductBeanFromData(String str, String key) {

                try {
                    JSONObject jsonObject = new JSONObject(str);
                    Type listType = new TypeToken<ArrayList<ProductBean>>() {
                    }.getType();

                    return new Gson().fromJson(jsonObject.getString(str), listType);

                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return new ArrayList();


            }

            public String getBuy_end_time() {
                return buy_end_time;
            }

            public void setBuy_end_time(String buy_end_time) {
                this.buy_end_time = buy_end_time;
            }

            public String getNumber() {
                return number;
            }

            public void setNumber(String number) {
                this.number = number;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getPlace() {
                return place;
            }

            public void setPlace(String place) {
                this.place = place;
            }

            public String getBrand() {
                return brand;
            }

            public void setBrand(String brand) {
                this.brand = brand;
            }

            public String getStore() {
                return store;
            }

            public void setStore(String store) {
                this.store = store;
            }

            public String getPublished() {
                return published;
            }

            public void setPublished(String published) {
                this.published = published;
            }

            public String getRelease_time() {
                return release_time;
            }

            public void setRelease_time(String release_time) {
                this.release_time = release_time;
            }

            public String getSell() {
                return sell;
            }

            public void setSell(String sell) {
                this.sell = sell;
            }

            public String getPresent() {
                return present;
            }

            public void setPresent(String present) {
                this.present = present;
            }

            public String getStock_quantity() {
                return stock_quantity;
            }

            public void setStock_quantity(String stock_quantity) {
                this.stock_quantity = stock_quantity;
            }

            public String getOut_stock() {
                return out_stock;
            }

            public void setOut_stock(String out_stock) {
                this.out_stock = out_stock;
            }

            public String getDisplayStockAvailability() {
                return DisplayStockAvailability;
            }

            public void setDisplayStockAvailability(String DisplayStockAvailability) {
                this.DisplayStockAvailability = DisplayStockAvailability;
            }

            public String getReminder() {
                return reminder;
            }

            public void setReminder(String reminder) {
                this.reminder = reminder;
            }

            public String getSx_price_name() {
                return sx_price_name;
            }

            public void setSx_price_name(String sx_price_name) {
                this.sx_price_name = sx_price_name;
            }

            public String getSx_price() {
                return sx_price;
            }

            public void setSx_price(String sx_price) {
                this.sx_price = sx_price;
            }

            public String getSp_weight() {
                return sp_weight;
            }

            public void setSp_weight(String sp_weight) {
                this.sp_weight = sp_weight;
            }

            public String getOld_price_name() {
                return old_price_name;
            }

            public void setOld_price_name(String old_price_name) {
                this.old_price_name = old_price_name;
            }

            public String getOld_price() {
                return old_price;
            }

            public void setOld_price(String old_price) {
                this.old_price = old_price;
            }

            public String getOld_price_weight() {
                return old_price_weight;
            }

            public void setOld_price_weight(String old_price_weight) {
                this.old_price_weight = old_price_weight;
            }

            public String getRate_price() {
                return rate_price;
            }

            public void setRate_price(String rate_price) {
                this.rate_price = rate_price;
            }

            public String getRate_weight() {
                return rate_weight;
            }

            public void setRate_weight(String rate_weight) {
                this.rate_weight = rate_weight;
            }

            public String getStandard() {
                return standard;
            }

            public void setStandard(String standard) {
                this.standard = standard;
            }

            public String getInfo() {
                return info;
            }

            public void setInfo(String info) {
                this.info = info;
            }

            public String getLast_time_info() {
                return last_time_info;
            }

            public void setLast_time_info(String last_time_info) {
                this.last_time_info = last_time_info;
            }

            public String getEnd_last_time() {
                return end_last_time;
            }

            public void setEnd_last_time(String end_last_time) {
                this.end_last_time = end_last_time;
            }

            public String getMax_end_time() {
                return max_end_time;
            }

            public void setMax_end_time(String max_end_time) {
                this.max_end_time = max_end_time;
            }

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getMax_qcp_end_time() {
                return max_qcp_end_time;
            }

            public void setMax_qcp_end_time(String max_qcp_end_time) {
                this.max_qcp_end_time = max_qcp_end_time;
            }

            public String getCollect() {
                return collect;
            }

            public void setCollect(String collect) {
                this.collect = collect;
            }

            public String getTotalPoint() {
                return TotalPoint;
            }

            public void setTotalPoint(String TotalPoint) {
                this.TotalPoint = TotalPoint;
            }

            public String getExsitReflex() {
                return ExsitReflex;
            }

            public void setExsitReflex(String ExsitReflex) {
                this.ExsitReflex = ExsitReflex;
            }
        }

        public static class BannerBean {
            private int PictureId;
            private String image;

            public static BannerBean objectFromData(String str) {

                return new Gson().fromJson(str, BannerBean.class);
            }

            public static BannerBean objectFromData(String str, String key) {

                try {
                    JSONObject jsonObject = new JSONObject(str);

                    return new Gson().fromJson(jsonObject.getString(str), BannerBean.class);
                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return null;
            }

            public static List<BannerBean> arrayBannerBeanFromData(String str) {

                Type listType = new TypeToken<ArrayList<BannerBean>>() {
                }.getType();

                return new Gson().fromJson(str, listType);
            }

            public static List<BannerBean> arrayBannerBeanFromData(String str, String key) {

                try {
                    JSONObject jsonObject = new JSONObject(str);
                    Type listType = new TypeToken<ArrayList<BannerBean>>() {
                    }.getType();

                    return new Gson().fromJson(jsonObject.getString(str), listType);

                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return new ArrayList();


            }

            public int getPictureId() {
                return PictureId;
            }

            public void setPictureId(int PictureId) {
                this.PictureId = PictureId;
            }

            public String getImage() {
                return image;
            }

            public void setImage(String image) {
                this.image = image;
            }
        }

        public static class ProductserivesBean {
            private String Id;
            private String BGColor;
            private String Name;
            private String WapUrl;
            private String ProductId;

            public static ProductserivesBean objectFromData(String str) {

                return new Gson().fromJson(str, ProductserivesBean.class);
            }

            public static ProductserivesBean objectFromData(String str, String key) {

                try {
                    JSONObject jsonObject = new JSONObject(str);

                    return new Gson().fromJson(jsonObject.getString(str), ProductserivesBean.class);
                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return null;
            }

            public static List<ProductserivesBean> arrayProductserivesBeanFromData(String str) {

                Type listType = new TypeToken<ArrayList<ProductserivesBean>>() {
                }.getType();

                return new Gson().fromJson(str, listType);
            }

            public static List<ProductserivesBean> arrayProductserivesBeanFromData(String str, String key) {

                try {
                    JSONObject jsonObject = new JSONObject(str);
                    Type listType = new TypeToken<ArrayList<ProductserivesBean>>() {
                    }.getType();

                    return new Gson().fromJson(jsonObject.getString(str), listType);

                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return new ArrayList();


            }

            public String getId() {
                return Id;
            }

            public void setId(String Id) {
                this.Id = Id;
            }

            public String getBGColor() {
                return BGColor;
            }

            public void setBGColor(String BGColor) {
                this.BGColor = BGColor;
            }

            public String getName() {
                return Name;
            }

            public void setName(String Name) {
                this.Name = Name;
            }

            public String getWapUrl() {
                return WapUrl;
            }

            public void setWapUrl(String WapUrl) {
                this.WapUrl = WapUrl;
            }

            public String getProductId() {
                return ProductId;
            }

            public void setProductId(String ProductId) {
                this.ProductId = ProductId;
            }
        }

        public static class PromotionalActivitiesBean {
            private String Id;
            private String TypeName;
            private String Name;
            private String Type;
            private String Descrption;
            private String ReferType;

            public static PromotionalActivitiesBean objectFromData(String str) {

                return new Gson().fromJson(str, PromotionalActivitiesBean.class);
            }

            public static PromotionalActivitiesBean objectFromData(String str, String key) {

                try {
                    JSONObject jsonObject = new JSONObject(str);

                    return new Gson().fromJson(jsonObject.getString(str), PromotionalActivitiesBean.class);
                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return null;
            }

            public static List<PromotionalActivitiesBean> arrayPromotionalActivitiesBeanFromData(String str) {

                java.lang.reflect.Type listType = new TypeToken<ArrayList<PromotionalActivitiesBean>>() {
                }.getType();

                return new Gson().fromJson(str, listType);
            }

            public static List<PromotionalActivitiesBean> arrayPromotionalActivitiesBeanFromData(String str, String key) {

                try {
                    JSONObject jsonObject = new JSONObject(str);
                    java.lang.reflect.Type listType = new TypeToken<ArrayList<PromotionalActivitiesBean>>() {
                    }.getType();

                    return new Gson().fromJson(jsonObject.getString(str), listType);

                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return new ArrayList();


            }

            public String getId() {
                return Id;
            }

            public void setId(String Id) {
                this.Id = Id;
            }

            public String getTypeName() {
                return TypeName;
            }

            public void setTypeName(String TypeName) {
                this.TypeName = TypeName;
            }

            public String getName() {
                return Name;
            }

            public void setName(String Name) {
                this.Name = Name;
            }

            public String getType() {
                return Type;
            }

            public void setType(String Type) {
                this.Type = Type;
            }

            public String getDescrption() {
                return Descrption;
            }

            public void setDescrption(String Descrption) {
                this.Descrption = Descrption;
            }

            public String getReferType() {
                return ReferType;
            }

            public void setReferType(String ReferType) {
                this.ReferType = ReferType;
            }
        }
    }
}
